package com.upay.android.controller.helper;

import java.math.BigDecimal;
import java.text.DecimalFormat;

import android.graphics.Color;
import android.widget.TextView;

public class Format {
	
	/* ---- Constants ---- */
    public static final DecimalFormat df = new DecimalFormat("######0.00");
    public static final DecimalFormat wf = new DecimalFormat("######0.0");
    
    /* ---- Business Methods ---- */
    public static String format(BigDecimal bigDecimal) {
    	return df.format(bigDecimal);
    }
    
    public static String formatWeight(BigDecimal bigDecimal) {
    	return wf.format(bigDecimal);
    }
    
    
    public static void drawBalance(TextView textView, BigDecimal value) {
		if (value.signum() == -1) {
			textView.setTextColor(Color.RED);
		} else {
			textView.setTextColor(Color.GREEN);
		}
    }
    
}
